package com.example.zzzfragmenttest;

import android.app.Fragment;
import android.app.FragmentManager;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class BBB extends Fragment implements OnClickListener{

	TextView tv;
	
	public BBB(){}
	
	@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.bbb, container, false);
        return rootView;
    }
	
	@Override
	public void onStart() {
		super.onStart();
		tv=(TextView)this.getView().findViewById(R.id.bbb);
		
		Button b=(Button) this.getView().findViewById(R.id.buttonB);
		b.setOnClickListener(this);
		
	}

	@Override
	public void onClick(View v) {
		Bundle save=new Bundle();
		save.putString("TEST","CHANGE");
		Fragment fragment = new CCC();
		fragment.setArguments(save); 
		FragmentManager fragmentManager = getFragmentManager();
		fragmentManager.beginTransaction()
				.replace(R.id.frame_container, fragment).commit();
		
	}
	
}
